﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Calendario1.styleDiaAtual = "styleDiaAtual";
        this.Calendario1.styleDiaNormal = "styleDiaNormal";
        this.Calendario1.styleDiaSelecionado = "styleDiaSelecionado";
        this.Calendario1.styleFimDeSemana = "styleFimDeSemana";
        this.Calendario1.styleCabecalho = "styleCabecalho";
        this.Calendario1.styleMesAnterior = "styleMesAnterior";
        this.Calendario1.styleMesPosterior = "styleMesPosterior";
        this.Calendario1.styleTitulo = "styleTitulo";
        this.Calendario1.styleEditarAno = "styleEditarAno";

    }

    protected override void Render(HtmlTextWriter writer)
    {
        base.Render(writer);

        for (int i = 0; i < this.Calendario1.DiasSelecionados.Length; i++)
            writer.Write(this.Calendario1.DiasSelecionados[i].ToString() + "<br />");

    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        this.Calendario1.DesmarcarTodasDatas();
    }

    protected void Button3_Click(object sender, EventArgs e)
    {
        Random a = new Random(DateTime.Now.Second);
        this.Calendario1.MarcarData(new DateTime(2009, a.Next(1, 12), a.Next(1, 20)));
    }

    protected void Button4_Click(object sender, EventArgs e)
    {
        this.Calendario1.DataInicial = new DateTime(1990, 2, 19);
    }
}
